//
//  HLNetWork.h
//  HLMusicBox
//
//  Created by hulinhu on 2017/12/27.
//  Copyright © 2017年 hulinhu. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void(^completionHandle)(id result);
typedef void(^failedHandle)(id result);
typedef void(^upLoadProgress)(double progress);
typedef void(^upLoadImageTask)(NSURLSessionUploadTask *upLoadImageTask);

@interface HLNetWork : NSObject


#pragma mark
#pragma mark - get post请求
+ (void)requestNetWorkURL:(NSString*)url
                        parmas:(NSDictionary*)parmas
            cacheTimeInSeconds:(NSInteger)cacheTime
                    completion:(completionHandle)completion
                        failed:(failedHandle)failedBlock;

#pragma mark
#pragma mark - 先加载缓存后请求
+ (void)requestFromCacheURL:(NSString *)url
                     parmas:(NSDictionary *)parmas
                 completion:(completionHandle)completion
                     failed:(failedHandle)failedBlock;


#pragma mark
#pragma mark - 图片上传
+ (void)uploadImageNetWorkURL:(NSString *)url
               paramas:(NSDictionary *)parmas
                 image:(UIImage *)image
            completion:(completionHandle)completion
                failed:(failedHandle)failedBlock;

@end
